.. highlightlang:: us .. index:: @f{labeldataset} .. _@f{labeldataset}: @f{labeldataset} ================ .. us.tag @f{labeldataset} NOTREADYENGLISH fieldfunction Changed5101 The field functions labels a curve with its legend text, set with :ref:`XYSetLegendText` or the y-channelname. Add the text object to the diagram that contains the dataset. If the dataset contains filter data it depends of the marker setting if the original data or the filter data is used to calculate the label position. If the function is called without parameters the last data point of the first dataset is labeled. If the label is dragged with the mouse the label is moved to the data point closest to the label position. .. function:: @f{labeldataset} @f{labeldataset(DatasetIndex)} @f{labeldataset(DatasetIndex, Index)} @f{labeldataset(DatasetIndex, Index, xOffset)} @f{labeldataset(DatasetIndex, Index, xOffset, yOffset)} @f{labeldataset(DatasetIndex, Index, xOffset, yOffset, nAlign)} @f{labeldataset(DatasetIndex, Index, xOffset, yOffset, nAlign, ssText)} @f{labeldataset(Name)} @f{labeldataset(Name, Index)} @f{labeldataset(Name, Index, xOffset)} @f{labeldataset(Name, Index, xOffset, yOffset)} @f{labeldataset(Name, Index, xOffset, yOffset, nAlign)} @f{labeldataset(Name, Index, xOffset, yOffset, nAlign, ssText)} .. us.params **Parameters** .. uparam:: DatasetIndex Index of the dataset in the diagram. Index starts with 1. .. uparam:: Name Dataset name, e.g. Data1. .. uparam:: Index Data point index which specifies the label position. A value of 0 specifies the data point with the smallest x-coordinate is labeled. A value of 1 specifies the the data point with the greatest x-coordinate is labeled. A negative index counts from the end of the dataset, e.g. -2 specifies the second last data point. A positive index counts from the beginning. Default is 1. .. uparam:: xOffset Offset in centimeters in x-direction. Default ist 0.0 cm. .. uparam:: yOffset Offset in centimeters in y-direction. Default ist 0.0 cm. .. uparam:: nAlign *nAlig* specifies, to which corner of the object the position coordinates refer. The value -1 sets the point automatically. .. uparam:: ssText If set to value **Y** the y-channelname is used to label the curve. Otherwise the text is used to label the curve. When the parameter is not specified the curves legend text is used as a label. .. us.example **Example** ``@f{labeldataset(Data1)}`` ``@f{labeldataset(1, 1)}`` ``@f{labeldataset(1, 1, 0.2)}`` Use y-channelname as label: ``@f{labeldataset(Data5, 1, 0.2, 0.0, -1, Y)}`` .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.10.10 - New parameter *nAlign* and *ssText* added. .. seealso:: :ref:`overview-field-functions`, :ref:`editupdate-fields`, :ref:`diagraminsert-field-function` :sub:`id-926120`